---
layout: "default"
title: "Operator: &*"
description: "Swift documentation for the '&*' operator."
root: "/v4.2"
---

<code class="language-swift"> operator &amp;* {
    associativity left
    precedence 
}</code>

<h3>Declarations</h3>

<div class="declaration inherited" id="func-ampstar_-self-rhs_-self">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-ampstar_-self-rhs_-self">func &amp;*(<wbr>_:<wbr> Self, rhs: Self)</a>
        
<div class="comment collapse" id="comment-func-ampstar_-self-rhs_-self"><div class="p">
    <p>Returns the product of the two given values, discarding any overflow.</p>

<p>The masking multiplication operator (<code>&amp;*</code>) silently discards any overflow
that occurs during the operation. In the following example, the product
of <code>10</code> and <code>50</code> is greater than the maximum representable <code>Int8</code> value,
so the result is the overflowed value:</p>

<pre><code class="language-swift">let x: Int8 = 10 &amp;* 5
// x == 50
let y: Int8 = 10 &amp;* 50
// y == -12 (after overflow)</code></pre>

<p><strong>Parameters:</strong>
  <strong>lhs:</strong> The first value to multiply.
  <strong>rhs:</strong> The second value to multiply.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func &amp;*(lhs: Self, rhs: Self) -&gt; Self</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/FixedWidthInteger/"><code>FixedWidthInteger</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-ampstar_-self-rhs_-self">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-ampstar_-self-rhs_-self">func &amp;*(<wbr>_:<wbr> Self, rhs: Self)</a>
        
<div class="comment collapse" id="comment-func-ampstar_-self-rhs_-self"><div class="p">
    <p>Returns the product of the two given values, discarding any overflow.</p>

<p>The masking multiplication operator (<code>&amp;*</code>) silently discards any overflow
that occurs during the operation. In the following example, the product
of <code>10</code> and <code>50</code> is greater than the maximum representable <code>Int8</code> value,
so the result is the overflowed value:</p>

<pre><code class="language-swift">let x: Int8 = 10 &amp;* 5
// x == 50
let y: Int8 = 10 &amp;* 50
// y == -12 (after overflow)</code></pre>

<p><strong>Parameters:</strong>
  <strong>lhs:</strong> The first value to multiply.
  <strong>rhs:</strong> The second value to multiply.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func &amp;*(lhs: Self, rhs: Self) -&gt; Self</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/FixedWidthInteger/"><code>FixedWidthInteger</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-ampstar_-self-rhs_-self">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-ampstar_-self-rhs_-self">func &amp;*(<wbr>_:<wbr> Self, rhs: Self)</a>
        
<div class="comment collapse" id="comment-func-ampstar_-self-rhs_-self"><div class="p">
    <p>Returns the product of the two given values, discarding any overflow.</p>

<p>The masking multiplication operator (<code>&amp;*</code>) silently discards any overflow
that occurs during the operation. In the following example, the product
of <code>10</code> and <code>50</code> is greater than the maximum representable <code>Int8</code> value,
so the result is the overflowed value:</p>

<pre><code class="language-swift">let x: Int8 = 10 &amp;* 5
// x == 50
let y: Int8 = 10 &amp;* 50
// y == -12 (after overflow)</code></pre>

<p><strong>Parameters:</strong>
  <strong>lhs:</strong> The first value to multiply.
  <strong>rhs:</strong> The second value to multiply.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func &amp;*(lhs: Self, rhs: Self) -&gt; Self</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/FixedWidthInteger/"><code>FixedWidthInteger</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-ampstar_-self-rhs_-self">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-ampstar_-self-rhs_-self">func &amp;*(<wbr>_:<wbr> Self, rhs: Self)</a>
        
<div class="comment collapse" id="comment-func-ampstar_-self-rhs_-self"><div class="p">
    <p>Returns the product of the two given values, discarding any overflow.</p>

<p>The masking multiplication operator (<code>&amp;*</code>) silently discards any overflow
that occurs during the operation. In the following example, the product
of <code>10</code> and <code>50</code> is greater than the maximum representable <code>Int8</code> value,
so the result is the overflowed value:</p>

<pre><code class="language-swift">let x: Int8 = 10 &amp;* 5
// x == 50
let y: Int8 = 10 &amp;* 50
// y == -12 (after overflow)</code></pre>

<p><strong>Parameters:</strong>
  <strong>lhs:</strong> The first value to multiply.
  <strong>rhs:</strong> The second value to multiply.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func &amp;*(lhs: Self, rhs: Self) -&gt; Self</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/FixedWidthInteger/"><code>FixedWidthInteger</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-ampstar_-self-rhs_-self">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-ampstar_-self-rhs_-self">func &amp;*(<wbr>_:<wbr> Self, rhs: Self)</a>
        
<div class="comment collapse" id="comment-func-ampstar_-self-rhs_-self"><div class="p">
    <p>Returns the product of the two given values, discarding any overflow.</p>

<p>The masking multiplication operator (<code>&amp;*</code>) silently discards any overflow
that occurs during the operation. In the following example, the product
of <code>10</code> and <code>50</code> is greater than the maximum representable <code>Int8</code> value,
so the result is the overflowed value:</p>

<pre><code class="language-swift">let x: Int8 = 10 &amp;* 5
// x == 50
let y: Int8 = 10 &amp;* 50
// y == -12 (after overflow)</code></pre>

<p><strong>Parameters:</strong>
  <strong>lhs:</strong> The first value to multiply.
  <strong>rhs:</strong> The second value to multiply.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func &amp;*(lhs: Self, rhs: Self) -&gt; Self</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/FixedWidthInteger/"><code>FixedWidthInteger</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-ampstar_-self-rhs_-self">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-ampstar_-self-rhs_-self">func &amp;*(<wbr>_:<wbr> Self, rhs: Self)</a>
        
<div class="comment collapse" id="comment-func-ampstar_-self-rhs_-self"><div class="p">
    <p>Returns the product of the two given values, discarding any overflow.</p>

<p>The masking multiplication operator (<code>&amp;*</code>) silently discards any overflow
that occurs during the operation. In the following example, the product
of <code>10</code> and <code>50</code> is greater than the maximum representable <code>Int8</code> value,
so the result is the overflowed value:</p>

<pre><code class="language-swift">let x: Int8 = 10 &amp;* 5
// x == 50
let y: Int8 = 10 &amp;* 50
// y == -12 (after overflow)</code></pre>

<p><strong>Parameters:</strong>
  <strong>lhs:</strong> The first value to multiply.
  <strong>rhs:</strong> The second value to multiply.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func &amp;*(lhs: Self, rhs: Self) -&gt; Self</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/FixedWidthInteger/"><code>FixedWidthInteger</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-ampstar_-self-rhs_-self">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-ampstar_-self-rhs_-self">func &amp;*(<wbr>_:<wbr> Self, rhs: Self)</a>
        
<div class="comment collapse" id="comment-func-ampstar_-self-rhs_-self"><div class="p">
    <p>Returns the product of the two given values, discarding any overflow.</p>

<p>The masking multiplication operator (<code>&amp;*</code>) silently discards any overflow
that occurs during the operation. In the following example, the product
of <code>10</code> and <code>50</code> is greater than the maximum representable <code>Int8</code> value,
so the result is the overflowed value:</p>

<pre><code class="language-swift">let x: Int8 = 10 &amp;* 5
// x == 50
let y: Int8 = 10 &amp;* 50
// y == -12 (after overflow)</code></pre>

<p><strong>Parameters:</strong>
  <strong>lhs:</strong> The first value to multiply.
  <strong>rhs:</strong> The second value to multiply.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func &amp;*(lhs: Self, rhs: Self) -&gt; Self</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/FixedWidthInteger/"><code>FixedWidthInteger</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-ampstar_-self-rhs_-self">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-ampstar_-self-rhs_-self">func &amp;*(<wbr>_:<wbr> Self, rhs: Self)</a>
        
<div class="comment collapse" id="comment-func-ampstar_-self-rhs_-self"><div class="p">
    <p>Returns the product of the two given values, discarding any overflow.</p>

<p>The masking multiplication operator (<code>&amp;*</code>) silently discards any overflow
that occurs during the operation. In the following example, the product
of <code>10</code> and <code>50</code> is greater than the maximum representable <code>Int8</code> value,
so the result is the overflowed value:</p>

<pre><code class="language-swift">let x: Int8 = 10 &amp;* 5
// x == 50
let y: Int8 = 10 &amp;* 50
// y == -12 (after overflow)</code></pre>

<p><strong>Parameters:</strong>
  <strong>lhs:</strong> The first value to multiply.
  <strong>rhs:</strong> The second value to multiply.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func &amp;*(lhs: Self, rhs: Self) -&gt; Self</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/FixedWidthInteger/"><code>FixedWidthInteger</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-ampstar_-self-rhs_-self">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-ampstar_-self-rhs_-self">func &amp;*(<wbr>_:<wbr> Self, rhs: Self)</a>
        
<div class="comment collapse" id="comment-func-ampstar_-self-rhs_-self"><div class="p">
    <p>Returns the product of the two given values, discarding any overflow.</p>

<p>The masking multiplication operator (<code>&amp;*</code>) silently discards any overflow
that occurs during the operation. In the following example, the product
of <code>10</code> and <code>50</code> is greater than the maximum representable <code>Int8</code> value,
so the result is the overflowed value:</p>

<pre><code class="language-swift">let x: Int8 = 10 &amp;* 5
// x == 50
let y: Int8 = 10 &amp;* 50
// y == -12 (after overflow)</code></pre>

<p><strong>Parameters:</strong>
  <strong>lhs:</strong> The first value to multiply.
  <strong>rhs:</strong> The second value to multiply.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func &amp;*(lhs: Self, rhs: Self) -&gt; Self</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/FixedWidthInteger/"><code>FixedWidthInteger</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-ampstar_-self-rhs_-self">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-ampstar_-self-rhs_-self">func &amp;*(<wbr>_:<wbr> Self, rhs: Self)</a>
        
<div class="comment collapse" id="comment-func-ampstar_-self-rhs_-self"><div class="p">
    <p>Returns the product of the two given values, discarding any overflow.</p>

<p>The masking multiplication operator (<code>&amp;*</code>) silently discards any overflow
that occurs during the operation. In the following example, the product
of <code>10</code> and <code>50</code> is greater than the maximum representable <code>Int8</code> value,
so the result is the overflowed value:</p>

<pre><code class="language-swift">let x: Int8 = 10 &amp;* 5
// x == 50
let y: Int8 = 10 &amp;* 50
// y == -12 (after overflow)</code></pre>

<p><strong>Parameters:</strong>
  <strong>lhs:</strong> The first value to multiply.
  <strong>rhs:</strong> The second value to multiply.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func &amp;*(lhs: Self, rhs: Self) -&gt; Self</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/FixedWidthInteger/"><code>FixedWidthInteger</code></a>    
</div></div>
</div>
